﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

/// <summary>
/// 无nameSpace
/// </summary>
public class CustomModel
{
    public void Test()
    {
        Debug.Log("This is a test funcation!");
    }

    public void TestPrivate()
    {
        Debug.Log("This is a private function!");
    }
}

/// <summary>
/// 有nameSpace
/// </summary>
namespace xLuaCustom
{
    public delegate void MyCustomOnClick(GameObject go);

    public class CustomModel
    {
        public void Test()
        {
            Debug.Log("Test");
        }

        public void TestWithArgs(int a)
        {
            Debug.Log("a = "+a);
        }

        public int TestWithReturnArgs(int a)
        {
            return a;
        }

        private int b;
        public int TestWithRefReturnArgs(int a, ref int b)
        {
            Debug.Log(string.Format("a={0},b={1}",a,b));
            return a;
        }

        public int TestWithOutReturnArgs(int a,out int _c)
        {
            _c = 3;
            return _c;
        }
    }
}

[XLua.LuaCallCSharp]
public class CustomeModelWithAttribute
{
    public static void Test()
    {
        Debug.Log("This is a static funcatin with attribute");
    }

    public static int TestWithReturnArgs(int a)
    {
        Debug.Log(a);
        return a;
    }

    public static int TestWithRefReturnArgs(int a, ref int b)
    {
        Debug.Log(string.Format("a={0},b={1}", a, b));
        return a;
    }
}
